<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div>
			<p>1</p>
			<p>2</p>
			<p>3</p>
			<p>
				<p>5</p>
				<p>4</p>
			</p>
		</div>
		
		<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
		<script>
			//返回所有子元素
			var p1 = $("div").children();
			for(var i=0;i<p1.length;i++){
				console.log(p1[i])
			}
			console.log("---------------------------------------")
			//返回所有的后代元素
			var p2 = $("div").find();
			for(var i=0;i<p2.length;i++){
				console.log(p2[i])
			}
		</script>
		
	</body>
</html>